style: enforce IDE0055 for CI builds#139
Conversation
📝 WalkthroughWalkthroughTwo test files undergo formatting-only changes. Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (6 passed)
Comment |
|
@coderabbitai autofix |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Pull request overview
This PR enables build-time enforcement of C# formatting diagnostics (IDE0055) by raising its severity to warning in the repo’s root .editorconfig, aligning with the repo’s existing CI/Release setting of EnforceCodeStyleInBuild=true. It also applies formatting-only updates in test code so the stricter formatting rule is satisfied.
Changes:
- Set
dotnet_diagnostic.IDE0055.severity = warningin the repo’s root.editorconfigfor C# files. - Reformat several single-line statements into block form in test helpers to comply with enforced formatting.
- Minor formatting change in the binlog-related test output loop.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.editorconfig |
Raises IDE0055 severity to enable build-time formatting diagnostics under EnforceCodeStyleInBuild. |
tests/ANcpLua.Sdk.Tests/TemplatesTests.cs |
Formatting-only updates in template scaffolding/build helpers. |
tests/ANcpLua.Sdk.Tests/SdkTests.cs |
Formatting-only update to the binlog output loop. |
| # Repo-local CI strictness: set IDE0055 to warning so it can be enforced by | ||
| # `EnforceCodeStyleInBuild` (Microsoft Learn: IDE0055 must be warning/error to | ||
| # run during build). |
Enforces C# formatting diagnostics (IDE0055) during CI/Release builds for this repo via a repo-local
.editorconfigoverride, matching modern .NET practice of treating formatting as at least warning-level.Also fixes a few formatting-only sites in tests that become actionable once IDE0055 is enforced.
Local verification:
CI=true dotnet build -c Releasedotnet test --project tests/ANcpLua.Sdk.Tests/ANcpLua.Sdk.Tests.csproj -c Release --filter-method "*EditorConfigsAreInBinlog*"Need help on this PR? Tag
@codesmithwith what you need.Summary by CodeRabbit